package com.huawei.service.impl;

import com.huawei.dao.UserMapper;
import com.huawei.dao.User_siteMapper;
import com.huawei.entity.User_site;
import com.huawei.service.User_siteService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName User_siteServiceImpl
 * @Description TODO
 * @Author 闫修奇
 * @Date 2021/11/27 17:14
 */

 @Service
public class User_siteServiceImpl implements User_siteService {
    @Resource
    User_siteMapper user_siteMapper;
    @Resource
    UserMapper userMapper;

    @Override
    public List<User_site> select(Map<String,Object>pars) {
        List<User_site> list=user_siteMapper.select(pars);
        for(User_site n:list){
            n.setUsers(userMapper.getId(n.getUser_id()));
        }

        return list;
    }

    @Override
    public int count(Map<String,Object>pars) {
        return user_siteMapper.count(pars);
    }

    @Override
    public int add(User_site user_site) {

            return user_siteMapper.add(user_site);

    }

   @Override
    public int update(User_site user_site) {

            return user_siteMapper.update(user_site);


    }

    @Override
    public int delete(int site_id) {
        return user_siteMapper.delete(site_id);
    }

    @Override
    public User_site getId(int id) {
        return user_siteMapper.getId(id);
    }

}
